package com.campus.service.impl;

import com.campus.service.CourseService;
import com.campus.dao.CourseDao;
import com.campus.model.Course;
import com.campus.model.LearnUnit;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * @desc:
 * @author: Tournesol234
 * @date: 2024/11/22 14.41
 */
@Service
public class CourseServiceImpl implements CourseService {

    private final CourseDao courseDao;

    public CourseServiceImpl(CourseDao courseDao) {
        this.courseDao = courseDao;
    }

    @Override
    public int createCourse(Course course) {
        return courseDao.createCourse(course);
    }

    @Override
    public Course getCourseById(int courseId) {
        return courseDao.getCourseById(courseId);
    }

    @Override
    public List<Course> getAllCourses() {
        return courseDao.getAllCourses();
    }

    @Override
    public int createLearnUnit(LearnUnit learnUnit) {
        return courseDao.createLearnUnit(learnUnit);
    }



        @Override
        public LearnUnit getLearnUnitById(int unitId) {
            return courseDao.getLearnUnitById(unitId);

    }
    @Override
    public List<LearnUnit> getLearnUnitsByCourseId(int courseId) {
        return courseDao.getLearnUnitsByCourseId(courseId);
    }
}
